hasValidCashFlows

fun hasValidCashFlows(cashFlows: List<ROICashFlowEntry>?, allowAllZerosCashFlows: Boolean): Boolean

Validates the list of cash flows to ensure it meets ROI/IRR requirements:

  • Must contain at least two entries.

  • Must include at least one positive and one negative value (cash flows on the same date are netted first)

  • All dates must be on or after the first date in the list

  • Optionally allow cashflows to contain all zero / near-zero values (otherwise this is invalid too)... note: MAX_CASHFLOW_PRECISION is used to detect very small cashflow values rather than zero.

Return

true if valid, false otherwise.

Since

MD2027

Parameters

cashFlows

List of cash flow entries to validate.

allowAllZerosCashFlows

Allows otherwise valid cashflows with values of all (or near-) zeros to report as valid.